package com.gshrms.org.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gshrms.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gshrms.org.mapper.OrgPostRankMapper;
import com.gshrms.org.domain.OrgPostRank;
import com.gshrms.org.service.IOrgPostRankService;

/**
 * 职级Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-29
 */
@Service
public class OrgPostRankServiceImpl extends ServiceImpl<OrgPostRankMapper,OrgPostRank> implements IOrgPostRankService
{
    @Autowired
    private OrgPostRankMapper orgPostRankMapper;

    /**
     * 查询职级
     * 
     * @param postRankId 职级主键
     * @return 职级
     */
    @Override
    public OrgPostRank selectOrgPostRankByPostRankId(Long postRankId)
    {
        return orgPostRankMapper.selectOrgPostRankByPostRankId(postRankId);
    }

    /**
     * 查询职级列表
     * 
     * @param orgPostRank 职级
     * @return 职级
     */
    @Override
    public List<OrgPostRank> selectOrgPostRankList(OrgPostRank orgPostRank)
    {
        return orgPostRankMapper.selectOrgPostRankList(orgPostRank);
    }

    /**
     * 新增职级
     * 
     * @param orgPostRank 职级
     * @return 结果
     */
    @Override
    public int insertOrgPostRank(OrgPostRank orgPostRank)
    {
        orgPostRank.setCreateTime(DateUtils.getNowDate());
        return orgPostRankMapper.insertOrgPostRank(orgPostRank);
    }

    /**
     * 修改职级
     * 
     * @param orgPostRank 职级
     * @return 结果
     */
    @Override
    public int updateOrgPostRank(OrgPostRank orgPostRank)
    {
        orgPostRank.setUpdateTime(DateUtils.getNowDate());
        return orgPostRankMapper.updateOrgPostRank(orgPostRank);
    }

    /**
     * 批量删除职级
     * 
     * @param postRankIds 需要删除的职级主键
     * @return 结果
     */
    @Override
    public int deleteOrgPostRankByPostRankIds(Long[] postRankIds)
    {
        return orgPostRankMapper.deleteOrgPostRankByPostRankIds(postRankIds);
    }

    /**
     * 删除职级信息
     * 
     * @param postRankId 职级主键
     * @return 结果
     */
    @Override
    public int deleteOrgPostRankByPostRankId(Long postRankId)
    {
        return orgPostRankMapper.deleteOrgPostRankByPostRankId(postRankId);
    }
}
